<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>北京科技报</title>
		<link href="css/common.css" rel="stylesheet">
		<link href="css/header.css" rel="stylesheet">
		<link href="css/videoList.css" rel="stylesheet">
		<link href="css/bookstarp.css" rel="stylesheet">
		<script src="js/vue.js"></script>
	</head>
	<body>
		<div id="vue_det">
			<div class="header-box">
				<div class="header flex align-end">
					<div class="flex-one">
						<img class="header-logo" src="images/logoff.png" />
						<div class="font-12 color-ff">聚焦科学传播 弘扬科学精神</div>
					</div>
					<div class="header-search-btn">
						<img class="header-search" src="images/search.png" />
					</div>
				</div>
				<div class="padding-lr-12 bg-ff" style="height: 43px;line-height: 43px;">
					<span class="font-12">当前位置：</span>
					<span class="font-12">合集</span>
					<span class="font-12">＞</span>
					<span class="font-12 color-main">视频列表</span>
				</div>
				<div class="flex align-center bg-ff padding-lr-12">
					<div class="header-xian flex-one"></div>
					<div class="header-radius"></div>
				</div>
			</div>
			<div class="box margin-top-120">
				<div class="container">

					<div id='container' class="flex flex-wrap justify-between margin-top-24">
						<div class="margin-bottom-14" style="width: 48%;">
							<a href="">
								<div class="position-relative">
									<img class="content-sm-img" src="images/app.png" />
									<div class="play-btn">
										<img src="images/play.png" alt="" />
									</div>
								</div>
								<div class="content-sm-word text-cut-two">提问科学家：争做辟谣小卫前多吃碳水化合物可争做辟谣小卫前多吃碳水化合物可
								</div>
							</a>
						</div>
						<div class="margin-bottom-14" style="width: 48%;">
							<a href="">
								<div class="position-relative">
									<img class="content-sm-img" src="images/app.png" />
									<div class="play-btn">
										<img src="images/play.png" alt="" />
									</div>
								</div>
								<div class="content-sm-word text-cut-two">提问科学家：争做辟谣小卫前多吃碳水化合物可争做辟谣小卫前多吃碳水化合物可
								</div>
							</a>
						</div>
						<div class="margin-bottom-14" style="width: 48%;">
							<a href="">
								<div class="position-relative">
									<img class="content-sm-img" src="images/app.png" />
									<div class="play-btn">
										<img src="images/play.png" alt="" />
									</div>
								</div>
								<div class="content-sm-word text-cut-two">提问科学家：争做辟谣小卫前多吃碳水化合物可争做辟谣小卫前多吃碳水化合物可
								</div>
							</a>
						</div>
					</div>
					<div class="text-center font-14 margin-top-14" style="color: #9CA5AD;">{{isLoading?'加载中':'滑动加载更多'}}</div>
				</div>
				<div class="flex flex-column align-center justify-center" style="margin-top: 50px;">
					<img src="images/none.png" style="width: 268px;height: 198px;">
					<div class="font-16 margin-top-14" style="color: #9CA5AD;">暂无相关信息</div>
				</div>
			</div>
		</div>
	</body>
</html>

<script>
	var vm = new Vue({
		el: '#vue_det',
		data: {
			status_type: 1,
			isLoading: false
		},
		mounted: function() {
			window.addEventListener('scroll', () => {
				const {
					scrollTop,
					scrollHeight,
					clientHeight
				} = document.documentElement;
				if (clientHeight + scrollTop >= scrollHeight && !this.isLoading) { // 5是个阈值，控制距离底部时加载
					this.loadMore();
				}
			});
		},
		methods: {
			loadMore: function() {
				this.isLoading = true;
				setTimeout(() => {
					// 获取容器元素
					var container = document.getElementById("container");
					// 创建一个新的div元素
					var newDiv =
						'<div class="margin-top-14" style="width: 48%;"><a href=""><div class="position-relative"><img class="content-sm-img" src="images/app.png" /><div class="play-btn"><img src="images/play.png" alt="" /></div></div><div class="content-sm-word text-cut-two">提问科学家：争做辟谣小卫前多吃碳水化合物可争做辟谣小卫前多吃碳水化合物可</div></a></div>';
					// 将新创建的div添加到容器的最后
					container.insertAdjacentHTML('beforeend', newDiv);

					this.isLoading = false;
				}, 500); // 模拟异步加载数据
			}
		}
	})
</script>